﻿// Shader-Based-Image-Processing (SBIP)
// http://code.google.com/p/sbip/
//
// Copyright © Frank Nagl, 2009-2010
// admin@franknagl.de
//
namespace SBIP.OptionsForms
{
    using System;
    using System.Windows.Forms;
    using Filter;

    /// <summary>Filter specified properties form.</summary>
    public partial class PosterizationForm : Form
    {
        readonly Posterization filter;

        /// <summary>
        /// Initializes a new instance of the <see cref="PosterizationForm"/> class.
        /// </summary>
        /// <param name="processor">The processor.</param>
        public PosterizationForm(Processor processor)
        {
            InitializeComponent();
            filter = new Posterization();
            processor.Filter = filter;
        }

        private void TrBarPosterizationValueChanged(object sender, EventArgs e)
        {
            filter.Threshold = (byte)TrBar.Value;
            lbThreshold.Text = TrBar.Value.ToString();
        }
    }
}
